﻿using System;
using MdcService.Log;
using MdcService.Structure.Enum;

namespace MdcService.Structure
{
    public class RunningContext
    {
        private ILogging _logging;
        private ServiceState _configurationServiceState;
        private ServiceState _realtimeDataServiceState;
        private ServiceState _historyDataServiceState;
        private ServiceState _recordingServiceState;
        private ServiceState _collectingServiceState;
        private ServiceState _responsingServiceState;
        private ServiceState _procedureServiceState;

        public RunningContext(ILogging logging)
        {
            _logging = logging;
        }

        public ServiceState ConfigurationServiceState
        {
            get { return _configurationServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(ConfigurationServiceState)} change to {ConfigurationServiceState}");
                _configurationServiceState = value;
            }
        }

        public ServiceState RealtimeDataServiceState
        {
            get { return _realtimeDataServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(RealtimeDataServiceState)} change to {RealtimeDataServiceState}");
                _realtimeDataServiceState = value;
            }
        }

        public ServiceState HistoryDataServiceState
        {
            get { return _historyDataServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(HistoryDataServiceState)} change to {HistoryDataServiceState}");
                _historyDataServiceState = value;
            }
        }

        public ServiceState RecordingServiceState
        {
            get { return _recordingServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(RecordingServiceState)} change to {RecordingServiceState}");
                _recordingServiceState = value;
            }
        }

        public ServiceState CollectingServiceState
        {
            get { return _collectingServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(CollectingServiceState)} change to {CollectingServiceState}");
                _collectingServiceState = value;
            }
        }

        public ServiceState ResponsingServiceState
        {
            get { return _responsingServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(ResponsingServiceState)} change to {ResponsingServiceState}");
                _responsingServiceState = value;
            }
        }

        public ServiceState ProcedureServiceState
        {
            get { return _procedureServiceState; }
            set
            {
                _logging.Debug(this,$"{nameof(ProcedureServiceState)} change to {ProcedureServiceState}");
                _procedureServiceState = value;
            }
        }
    }

    
}
